package SQL.abysnSQL;

import ErrorMsg.DBTypeNotMatchException;

public class FloatValue extends ConstValue{
	public float value;
	
	public FloatValue(int l, int r){
		value = (float)l + ((float)r / (float)(Math.pow(10, Math.log10(r)+1)));
	}
	
	public FloatValue(float f){
		value = f;
	}
	
	public String toString() {
		try {
			return this.floatValue()+"";
		} catch(Exception e) {
			e.printStackTrace();
			return null;
		}
	}
	@Override
	public float floatValue() throws DBTypeNotMatchException {
		return value;
	}

	@Override
	public int intValue() throws DBTypeNotMatchException {
		return (int) value;
	}

	@Override
	public String stringValue() throws DBTypeNotMatchException {
		throw new DBTypeNotMatchException(new Exception());
	}
}